const state = {
    statenum: '1',
    stateContent:[
        {clause_id:1,clause_text:'会员注册',clause_title:'未连接到服务器'},
        {clause_id:2,clause_text:'隐私保护注册',clause_title:'未连接到服务器'},
        {clause_id:3,clause_text:'在线认购注册',clause_title:'未连接到服务器'},
        {clause_id:4,clause_text:'优惠券服务协议',clause_title:'未连接到服务器'},
        {clause_id:5,clause_text:'会员购房补贴',clause_title:'未连接到服务器'},
        {clause_id:6,clause_text:'看房直通车',clause_title:'未连接到服务器'},
    ]


}
/*action里面可以放异步操作*/
const actions = {
    saveStateNum({ commit }, num) {
        commit('setStatenum', num) /*commit('里面放mutation方法里面的名字')*/
    },
    saveContentAct({ commit }, arr) {
        commit('saveContentMut', arr) /*commit('里面放mutation方法里面的名字')*/
    }
}

const mutations = {
    setStatenum(state, activeName) {
        state.statenum = activeName;
    },
    saveContentMut(state,arr) {
        console.log('存储的数据')
        console.log(arr)
        state.stateContent=[...arr]
    },
}
export default {
    state,
    actions,
    mutations
}